package com.share.dbutils;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

/**
 * Created by leep on 2015-12-25.
 */
public class DataSourceFactory {
	static MysqlDataSource dataSource;

	public static MysqlDataSource getDataSource() {
		if (dataSource == null) {
			dataSource = new MysqlDataSource();
			dataSource.setPassword(DBConf.PASS);
			dataSource.setUser(DBConf.USER);
			dataSource.setURL(DBConf.DB_URL);
		}
		return dataSource;
	}
}
